#include "GameController.h"

//左摇杆监听器，在主循环中执行
void GameController::checkLeftJoyStick(){
  //限幅，摇杆原点处小范围浮动不计算数值
  if(abs(this->xLeftJS) + abs(this->yLeftJS)){
    //底盘执行左右转
    this->chassis.turnLeft((double)(this->xLeftJS + this->yLeftJS) * 2);
    this->chassis.turnRight((double)(this->xLeftJS - this->yLeftJS) * 2);
  }else{

  }
}

//右摇杆监听器，在主循环中执行
void GameController::checkRightJoyStick(){
  this->chassis.stopMoving();
}